home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 49 / Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso / -websites- / wirenet / files / updatewirenet.lzx / Updates / Fetch.body < prev    next >
Text File  |  2011-03-01  |  1KB  |  46 lines

  1. NumSockets = 2                                  /* The number of sockets for Thor to use */
  2. MaxTries   = 5                                  /* Maximum number of retries */
  3.  
  4. /* Don't change anything below here */
  5.  
  6. arg option
  7.  
  8. if ~show('L','rexxdossupport.library') then
  9.   call addlib('rexxdossupport.library',0,-30)
  10.  
  11. options results
  12. address command
  13. options failat 21
  14.  
  15. CmdStr = GetVar('Thor/ThorPath')'bin/GetTCP' SystemName 'PUBSCREEN Workbench GETONLY'
  16. MailStr = 'DELETE PASSWORD' Password 'MAILSERVER $MAILSERVER USERNAME $MAILBOX'
  17. NewsStr = 'NEWSSERVER $NEWSSERVER SOCKETS' NumSockets
  18.  
  19. select
  20.     when option = 'MAIL' then CmdStr = CmdStr 'NONEWS' MailStr
  21.     when option = 'NEWS' then CmdStr = CmdStr 'NOMAIL' NewsStr
  22.     when option = 'ALL'  then CmdStr = CmdStr MailStr NewsStr
  23.     otherwise ErrorMsg('Usage: Fetch Mail|News|All')
  24.     end
  25.  
  26. do try = 1 to MaxTries
  27.     CmdStr
  28.     if RC=0 then do
  29.         leave try
  30.         end
  31.     end
  32.  
  33. if try > MaxTries then ErrorMsg('Failed to get mail after' MaxTries 'attempts')
  34.  
  35. exit
  36.  
  37.  
  38. ErrorMsg: Procedure
  39.     parse arg Msg
  40.     say
  41.     say(Msg)
  42.     say
  43.     exit
  44.     return
  45.  
  46.